#include <stdio.h>
#include <pthread.h>
#include <unistd.h>

void *hello(void *arg){
    printf("hello world\n");
    sleep(2);
    pthread_exit(NULL);
}
int main(int argc, char const *argv[])
{
    pthread_t pid;
    pthread_create(&pid, NULL, hello, NULL);
    printf("main thread\n");
    sleep(3);
    pthread_detach(pid);
    printf("main thread end\n");
    return 0;
}
